package com.surveillance.entities;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity
@Table(name = "service", uniqueConstraints = { @UniqueConstraint(columnNames = { "id" }) })
public class Servicee extends BaseEntity {

	/**
	 * 
	 */
	
	@Column(name = "NOM")
	private String nom;
	@Column(name = "DEPARTEMENT")
	private String dept;
	@Column(name = "EFFECTIF")
	private int effectif;
	@OneToMany(fetch = FetchType.EAGER, targetEntity = Surveillant.class)
	private Set<Surveillant> surveillants = new HashSet<Surveillant>(0);

	public Servicee(){
		
	}
	
  	public Servicee(String nom, String dept, int effectif,
			Set<Surveillant> surveillants) {
		super();
		this.nom = nom;
		this.dept = dept;
		this.effectif = effectif;
		this.surveillants = surveillants;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getDept() {
		return dept;
	}

	public void setDept(String dept) {
		this.dept = dept;
	}

	public int getEffectif() {
		return effectif;
	}

	public void setEffectif(int effectif) {
		this.effectif = effectif;
	}

	public Set<Surveillant> getSurveillants() {
		return surveillants;
	}

	public void setSurveillants(Set<Surveillant> surveillants) {
		this.surveillants = surveillants;
	}
	

	@Override
	public String toString() {
		return "Service [id=" + id + ", nom=" + nom + ", dept=" + dept
				+ ", effectif=" + effectif + ", surveillants=" + surveillants
				+ "]";
	}
}
